<template>
	<view class="big_box">
		<!-- text -->
		<view class="box1" v-for="item in list1" v-if="item.query05 == 'text'">
			<view>{{item.query04}}</view>
			<input v-model="item.query07" type="text" placeholder="请输入">
		</view>
		<!-- textarea -->
		<view class="box2" v-for="item in list1" v-if="item.query05 == 'textarea'">
			<view class="box2_1">{{item.query04}}</view>
			<textarea v-model="item.query07" value="" placeholder="" />
		</view>
		<!-- date -->
		<view class="box1" v-for="(item,index) in list1" v-if="item.query05 == 'date'">
			<view>{{item.query04}}</view>
			<type :dat="{type:'date',num:index,item:item}" @w_rq="w_rq"></type>
		</view>
		
		<view class="all_btn brn_all" @click="tj()">提交</view>
	</view>
</template>

<script>
	import type from '@/component/type.vue'
	export default {
		data() {
			return {
				dat:'',
				list1:[]
			}
		},
		components:{type},
		onLoad:function(option) {
			this.dat = JSON.parse(option.item)
			console.log(this.dat)
			uni.setNavigationBarTitle({
				title:this.dat.query11
			})
			this.initial()
		},
		methods: {
			tj:function(){
				console.log(this.list1)
				this.$post('busedh/fxjBuse_15/addFxjBuseitem_12',{
					rid:this.dat.id,
					query09:JSON.stringify(this.list1)
				}).then(res=>{
					console.log(res,1111)
				})
			},
			w_rq:function(e){
				console.log(e)
				this.list1.forEach((item)=>{
					item.data.forEach((item1)=>{
						if(e.item.id == item1.id){
							item1.query07 = e.name
						}
						console.log(item1)
					})
				})
			},
			initial:function(){
				this.$get('base/fxjBase_19/list',{
					query01:this.dat.query11
				}).then(res=>{
					this.list1 = res.data.result.records
					console.log(res.data.result.records)
				})
			}
		}
	}
</script>

<style>
	.brn_all{
		margin-top: 30rpx;
	}
	textarea{
		width: 100%;
		border: 1px solid #CCCCCC;
		border-radius: 10rpx;
		padding: 30rpx;
		box-sizing: border-box;
	}
	.box2_1{
		margin: 15px 10px;
	}
	.box2{
		font-size:30rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(0,0,0,1);
	}
	.box1>input{
		text-align: right;
		font-size:30rpx;
	}
	.box1{
		height:88rpx;
		background:rgba(250,250,250,0.3);
		border:1px solid rgba(230,230,230,1);
		border-radius:10rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 20rpx;
		box-sizing: border-box;
		font-size:30rpx;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(0,0,0,1);
		margin-top: 20rpx;
	}
	.big_box{
		padding: 30rpx;
		box-sizing: border-box;
	}
</style>
